home *** CD-ROM | disk | FTP | other *** search
- on centerVert snum, t, sh, mh, wButton
- if wButton <> #NONE then
- if (sh < (mh - 35)) and (sh > (mh - 70)) then
- if wButton = #top then
- set t to t + 35
- end if
- set mh to mh - 35
- set value to 0
- else
- set value to sh > (mh - 35)
- end if
- else
- set value to 0
- end if
- set hdiff to (mh - sh) / 2
- spriteBox(snum, 1000, t + hdiff, 1000 + the width of sprite snum, t + sh + hdiff)
- return value
- end
-
- on alignChallenge ChallengeIndex, ChallengeOrder, page, NormSize, blindfold
- global gScreenMode, gType
- if getaProp(gScreenMode, #TXTRESP) = #ALONE then
- set TextCast to 113
- else
- set TextCast to 49
- end if
- set index to value(char ChallengeIndex of ChallengeOrder) + ((page - 1) * 4)
- if getaProp(gScreenMode, #TXTCHAL) = #ONPCT then
- hide9()
- updateStage()
- set the text of cast (TextCast - 5) to the text of cast (344 + index)
- set the textSize of cast (TextCast - 5) to NormSize
- if gType = #PC then
- set the textHeight of cast (TextCast - 5) to NormSize + 2
- end if
- if blindfold then
- alignText(10, TextCast - 5, 2, 160, 1, #bottom)
- else
- alignText(10, TextCast - 5, 2, 160, 1, #NONE)
- end if
- else
- hide7()
- updateStage()
- set the text of cast (TextCast - 6) to the text of cast (344 + index)
- set the textSize of cast (TextCast - 6) to NormSize
- if gType = #PC then
- set the textHeight of cast (TextCast - 6) to NormSize + 2
- end if
- alignText(8, TextCast - 6, 1, 57, 0, #NONE)
- end if
- end
-
- on alignText snum, cnum, t, mh, tryCenter, wButton
- global gSmallSize, gType
- set sh to the bottom of sprite snum - the top of sprite snum
- if sh > mh then
- set the textSize of cast cnum to gSmallSize
- if gType = #PC then
- set the textHeight of cast cnum to gSmallSize + 2
- end if
- set sh to the bottom of sprite snum - the top of sprite snum
- set whatisthis to centerVert(snum, t, sh, mh, wButton)
- else
- if wButton <> #NONE then
- if sh > (mh - 35) then
- set the textSize of cast cnum to gSmallSize
- if gType = #PC then
- set the textHeight of cast cnum to gSmallSize + 2
- end if
- set sh to the bottom of sprite snum - the top of sprite snum
- end if
- end if
- set whatisthis to centerVert(snum, t, sh, mh, wButton)
- end if
- if tryCenter then
- if sh <= 22 then
- set the textAlign of field cnum to "center"
- else
- set the textAlign of field cnum to "left"
- end if
- end if
- put RETURN after field cnum
- end
-
- on alignResponse which, ResponseOrder, page, NormSize
- global gScreenMode, gType
- if getaProp(gScreenMode, #TXTRESP) = #ALONE then
- set TextCast to 113
- else
- set TextCast to 49
- end if
- if getaProp(gScreenMode, #SNDRESP) <> #NONE then
- set Botlocs to "#BOTTOM,#BOTTOM,#TOP,#TOP"
- else
- set Botlocs to "#NONE,#NONE,#NONE,#NONE"
- end if
- if getaProp(gScreenMode, #SCREEN) = #TYPE1 then
- set Tops to "58,58,222,222"
- set h to 160
- else
- set Tops to "169,169,278,278"
- set h to 105
- end if
- if which = 0 then
- hideTextPuppets()
- set st to 0
- set en to 3
- else
- hideTextPuppet(which)
- set st to which - 1
- set en to which - 1
- end if
- updateStage()
- set base to (page - 1) * 4
- repeat with i = st to en
- set index to value(char i + 1 of ResponseOrder) + base
- set the text of cast (TextCast + i) to the text of cast (344 + index)
- set the textSize of cast (TextCast + i) to NormSize
- if gType = #PC then
- set the textHeight of cast (TextCast + i) to NormSize + 2
- end if
- alignText(8 + i, TextCast + i, value(item i + 1 of Tops), h, 1, value(item i + 1 of Botlocs))
- showTextPuppet(i + 1)
- end repeat
- end
-
- on drawText
- global gScreenMode, gResponseOrder, gPage, gNormSize, gChallengeIndex, gChallengeOrder, gBlindfold
- if getaProp(gScreenMode, #TXTRESP) <> #NONE then
- alignResponse(0, gResponseOrder, gPage, gNormSize)
- else
- if getaProp(gScreenMode, #TXTCHAL) <> #NONE then
- alignChallenge(gChallengeIndex, gChallengeOrder, gPage, gNormSize, gBlindfold)
- end if
- end if
- end
-